package ThreadPoolCheck.RuleIssue;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by wangyg6 on 2017/11/7.
 */
public class MapCache {
	public static ThreadLocal<Map<String, String>> caches = new ThreadLocal<Map<String, String>>();
	public static Map<String, String> cacheForTest = new HashMap<>();

	private MapCache() {
	}

	private static volatile MapCache instance = new MapCache();

	public static MapCache getInstance() {
		return instance;
	}

	public static Map<String, String> getCache() {
		return caches.get();
	}

	public static void setCache(Map<String, String> cache) {
		caches.set(cache);
	}
	public static void remove(){
		caches.remove();
	}
}
